package com.eight.order.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.eight.order.dao.CourseDao;
import com.eight.order.pojo.Course;
import com.eight.order.service.CourseService;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import javax.annotation.Resource;
import java.util.List;

/**
 * @program: qy8-education
 * @description:
 * @author: 郑友民（1460115388@qq.com）
 * @create: 2023-05-26 20:37
 **/
@Service
public class CourseServiceImpl implements CourseService {
    @Resource
    private CourseDao courseDao;
    @Override
    public List<Course> queryAllCourse(String courseId) {
        QueryWrapper<Course> wrapper = new QueryWrapper<>();
        if (StringUtils.hasText(courseId)){
            wrapper.eq("id",courseId);
        }

        List<Course> courses = courseDao.selectList(wrapper);
        return courses;
    }
}

